<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title></title>
    <script src="../vue.js"></script>
</head>
<body>
<div id="app">
    <ul>
        <li v-for="n in even(numbers)">{{n}}</li>
    </ul>
</div>

<script>
    var vm = new Vue({
        el: "#app",
        data: {
            numbers:[1,2,3,4,5,6,8]
        },
//        computed:{
//            evenNumbers: function () {
//                return this.numbers.filter(function (number) {
//                    return number%2===0
//                })
//            }
//        }
        methods:{
            even: function (numbers) {
                return numbers.filter(function (number) {
                    return number%2===0
                })
            }
        }
    })
</script>
</body>
</html>